<include file="Public:header" />
<load href="__JS__/upload/uploadify.css" />
<load href="__JS__/swfobject.js" />
<script type="text/javascript" src="__JS__/jquery.uploadify.v2.1.4.min.js"></script> 
<script type="text/javascript" src="__JS__/jianfanzhuanhuan.js"></script>

<!--模糊查询js与css文件-->
<link type="text/css" rel="stylesheet" href="__JS__/jqueryUI/themes/base/jquery.ui.all.css" />
<script type="text/javascript" src="__JS__/jqueryUI/ui/jquery-ui.js"></script>	
<div class="content">
<!-----------------------------------------内容开始--------------------------------------------------->
<div class="infoBox">
<script>
</script>

<form name="form" action="{:U('dopage_art')}" method="post" onsubmit="return checkform();">
<input type="hidden" name="id" value="{$id}" />

<style>
.infoBoxTd{width:15%;min-width:100px;}
.checkboxml{margin-left:10px;}
.fred{color:#CC0000;}
.zishutishi{width:400px;height:80px;line-height:80px;font-size:22px;padding:0px 40px;color:#f00;background:url(__PUBLIC__/images/btm_bg_hei.png) repeat;position:fixed;left:20%;top:20%;z-index:999;display:none;}
</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left"><a href="./index.php?a=page_art&m=index&arid={$id}" target="_blank" class="buttom" >预览</a></td>
	</tr>
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left"><a href="javascript:;" class="buttom auto_paiban_textarea" >自动排版</a></td>
	</tr>
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left">
			<php>
			if(!$state){
			</php>
				<input type="submit" name="Button1" value="提交审核" class="formInput01" />
			<php>
			}else{
			</php>
				<input type="submit" name="Button1" value="保存" class="formInput01" />
			<php>
			}
			</php>
		</td>
	</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="basic">
<tr>
	<td class="infoBoxTd">标题：</td>
	<td colspan="2">
	<INPUT id="name" name="name" value="{$name}" class="formTitle" size="80" >
	<br />
	<a href="javascript:;" onclick="zhuanjft(this)" class="buttom" style="margin-top:5px;"  >自动转换简繁体</a>
	</td>
</tr>
<volist name="lang_name" id="lang_name">
<tr>
<td width="11%" class="infoBoxTd">标题（<span class="lang_name" lang_daihao="{$lang_name.nid}">{$lang_name.name}</span>）：</td>
<td colspan="2">
<input type="text" name="name{$lang_name.id}" value="{$lang_name.menu_name}" class="formTitle" size="80"  style="float:left;margin-right:10px;" />
<br />
<eq name="lang_name.nid" value="L01"> <a href="javascript:;" onclick="zhuanft(this)" class="buttom" style="margin-top:5px;"  >将简体转换为繁体</a></eq>
<eq name="lang_name.nid" value="L02"> <a href="javascript:;" onclick="zhuanjt(this)" class="buttom" style="margin-top:5px;"  >转换简体</a></eq>
</td>
</tr>
</volist>

<tr>
    <td class="infoBoxTd" >文章内容：</td>
    <td colspan="2">
		<textarea id="content" name="content" style="width:800px;height:300px;" >{$content|stripslashes}</textarea>
		<br />
		<a href="javascript:;" onclick="zhuanjft(this)" class="buttom"  >自动转换简繁体</a>
	</td>
</tr>
<volist name="lang_content" id="lang_content">
<tr>
    <td class="infoBoxTd" >文章内容（<span class="lang_name" lang_daihao="{$lang_content.nid}">{$lang_content.name}</span>）：</td>
    <td colspan="2">
		<textarea id="content{$lang_content.id}" name="content{$lang_content.id}" style="width:800px;height:300px;" >{$lang_content.menu_content|stripslashes}</textarea>
		<br />
		<eq name="lang_content.nid" value="L01"> <a href="javascript:;" onclick="zhuanft(this)" class="buttom" >将简体转换为繁体</a></eq>
		<eq name="lang_content.nid" value="L02"> <a href="javascript:;" onclick="zhuanjt(this)" class="buttom" >转换简体</a></eq>
	</td>
	<script type="text/javascript">
	//编辑器
	var k00{$lang_content.id}; //文章内容
	KindEditor.ready(function(K) {
		k00{$lang_content.id} = K.create('#content{$lang_content.id}', {
			allowFileManager : true
		});
	});
	</script>
</tr>
</volist>

<tr>
	<td class="infoBoxTd">排序：</td>
	<td colspan="2"><INPUT id="xu" name="xu" value="{$xu}" class="formTitle" size="80" ></td>
</tr>

<tr>
	<td class="infoBoxTd">上刊时间：</td>
	<td colspan="2"><gt name="ctime" value="0">{$ctime|date='Y-m-d H:i:s',###}</gt></td>
</tr>

<tr>
	<td class="infoBoxTd">上次修改时间：</td>
	<td colspan="2"><gt name="stime" value="0">{$stime|date='Y-m-d H:i:s',###}</gt></td>
</tr>

<tr>
	<td class="infoBoxTd">被阅读次数：</td>
	<td colspan="2">{$readss}</td>
</tr>

<tr>
	<td class="infoBoxTd">被关注次数：</td>
	<td colspan="2">{$follows}</td>
</tr>

</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left"><a href="./index.php?a=page_art&m=index&arid={$id}" target="_blank" class="buttom" >预览</a></td>
	</tr>
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left"><a href="javascript:;" class="buttom auto_paiban_textarea" >自动排版</a></td>
	</tr>
	<tr>
		<td class="infoBoxTd">&nbsp;</td>
		<td align="left">
			<php>
			if(!$state){
			</php>
				<input type="submit" name="Button1" value="提交审核" class="formInput01" />
			<php>
			}else{
			</php>
				<input type="submit" name="Button1" value="保存" class="formInput01" />
			<php>
			}
			</php>
		</td>
	</tr>
</table>
</form>
</div>
<!-----------------------------------------内容结束--------------------------------------------------->
</div>
    

<include file="Public:footer" />
<script type="text/javascript">
//编辑器
var k1; //文章内容
KindEditor.ready(function(K) {
	k1 = K.create('#content', {
		allowFileManager : true
	});
});

function checkform(){
	if($('#name').val()==''){
		alert("请输入标题");
		return false;exit;
	}
}
$(document).ready(function(){
	//点击自动排版按钮时，为各个编辑器自动排版 图片和文字段落宽度都是650px
	$(".auto_paiban_textarea").on("click",function(){

		$("textarea").each(function(){
			$(this).parent().find("iframe").contents().find("body img").css('text-indent',"0");
			$(this).parent().find("iframe").contents().find("body img").css("height","auto");
			$(this).parent().find("iframe").contents().find("body img").width('100%');
			$(this).parent().find("iframe").contents().find("body p").css('text-indent',"0");
			$(this).parent().find("iframe").contents().find("body span").css('text-indent',"0");
			$(this).parent().find("iframe").contents().find("body p").css('font-size',"14px");
			$(this).parent().find("iframe").contents().find("body span").css('font-size',"14px");
			$(this).parent().find("iframe").contents().find("body p").css('color',"#333");
			$(this).parent().find("iframe").contents().find("body span").css('color',"#333");
//			$(this).parent().find("iframe").contents().find("body p").css('margin',"0");
//			$(this).parent().find("iframe").contents().find("body span").css('margin',"0");
			$(this).parent().find("iframe").contents().find("body img").css('margin',"0 auto");
		});
	}); 


});

</script>
